<?php
/**
 * Created by JetBrains PhpStorm.
 * User: Bezdelnick
 * Date: 25.04.13
 * Time: 0:39
 * To change this template use File | Settings | File Templates.
 */
require_once("Config.php");
require_once("persistence/Country.php");
require_once("dao/CountryDao.php");

$countryDao = new CountryDao();

if (isset($_POST['load_by_film_id']))
    $countries = $countryDao->loadByFilmId($_POST['load_by_film_id']);
else
    $countries = $countryDao->load();
?>

<select name="film_countries[]" multiple="multiple" class="jquery-multi-select">
    <? foreach ($countries as $country) { ?>
    <option value="<?= $country->getId() ?>"> <?= $country->getName() ?> </option>
    <? } ?>
</select>